<template>
	<view class="page">
		<view class="recommend-info">
			<view class="goods-list">
				<view class="list flex " v-for="(item,index) in goodsList" @click="onSkip('/pages/GoodsDetails/GoodsDetails?id='+item.code+'&type=1')" :key="index" v-if="goodsList.length!=0">
					<view class="pictrue">
						<image :src="item.cover"></image>
					</view>
					<view class="right" style="width: 100%;">
						<view class="title-tag">
							<view class="tag">
								<text v-if="item.is_goods === 1">特价</text>
								{{item.name}}
							</view>
						</view>
						<view class="price-info flex flex-align flex-bt">
							<view class="user-price">
								<text class="min">￥</text>
								<text class="max">{{item.price_selling}}</text>
							</view>
							<view class="vip-price flex flex-center flex-align">
								<tui-icon name="cart" color="#fff" :size="18"></tui-icon>
							</view>
						</view>
					</view>
					
				</view>
				<view class="empty-box" v-if="goodsList.length==0" style="padding-top: 20rpx;">
					<image src="/static/ic_nodata.png" mode=""></image>
					<view class="" style="color: #999;">暂无商品</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// 引入mescroll-mixins.js
	export default {
		data() {
			return {
				goodsList: [ ],
				page:1,
			}
		},
		onLoad(e) {
			let that = this
			
		},
		onShow() {
			let that = this
			
			that.page=1
			that.getList()
			
		},
		methods: {
			getList(){
				let that = this
				that.tui.request("api.data/goods", "POST", {page:that.page,category_id:0}, false, false, true).then((res) => {
					if(res.code==1){
						that.goodsList = res.data.list
						
					}
				}).catch((res) => {
					
				})
			},
			onSkip(e){
				this.tui.href(e)
			},
		}
	};
</script>

<style scoped lang="scss">
	@import 'home.scss';
	// .rule-win{
	// 	.cu-bar{background: url('/static/head_bg.png') no-repeat;background-size: 100% 100%;height: 240rpx;position: relative;
	// 		.text-red{color: #fff;font-weight: bold;}
	// 		.imgIms{width: 160rpx;height: 160rpx;position: absolute;bottom: -50rpx;left: 50%;margin-left: -80rpx;background: #fff;border-radius: 100%;
	// 			image{width: 130rpx;height: 130rpx;}
	// 		}
	// 	}
	// 	.rule-content{background: #fff;
	// 		padding: 60rpx 4% 40rpx;
	// 		text-align: center;
	// 		.wenzi{font-weight: bold;font-size: 30rpx;margin-bottom: 20rpx;}
	// 		.tishi{color: #999;font-size:24rpx;padding: 10rpx 0 0 0;}
	// 		.btns{width: 240rpx;color: #fff;line-height: 70rpx;border-radius: 6rpx;background: #ff0101;margin: 40rpx auto 0;}
	// 	}
	// }
	.rule-win{
		.rule-content{background: #fff;
			padding: 20rpx 4%;
			text-align: left;
			text{
				font-size: 26rpx;
				color: #555555;
				text-align: left;
				line-height: 50rpx;
			}
		}
	}
</style>